home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 January / PSL Monthly Shareware CD-ROM (Public Software Library) (January 1994).iso / games / dos / misc / whabuse.exe / WHABUSE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-04  |  10.2 KB  |  227 lines

  1. /* program after abuse command found on a Berkley 4.3 unix system
  2.    gives N instances of typewritten abuse at 10 sec intervals from the command:
  3.       whabuse  N
  4.    or just one typewritten comment if no argument 
  5.    press CTRL-BREAK to interrupt.
  6.  
  7.    PLEASE review text in abusetb below -- add to / deleet as needed
  8.  
  9.    define ANSIC for Borland C++ 2.0 or for MicroSoft C 6.0
  10.      cl /AL /DANSIC abusive.c         // I use the large model with MSC 6.0
  11.      bcc -DANSIC abusive.c            // Defaults OK with Borland C++ 2.0
  12.    define BSD43 for c compiler on VAX under Berkley UNIX 4.3
  13.      cc -DBSD43 -o abusive abusive.c  // this should fly under BSD 4.2 & 4.3
  14.  
  15.    w.howell  CIS 70215,206   10/4/91
  16.  */
  17.  
  18. #include <stdio.h>
  19. #include <time.h>
  20.  
  21. #ifdef ANSIC
  22. #include <stdlib.h>
  23. #include <sys\timeb.h>
  24. #endif
  25.  
  26. #ifdef BSD43
  27. typedef int time_t;
  28. #include <sys/timeb.h>
  29. #include <ctype.h>
  30. #define  RAND_MAX  2147483648.0
  31. #endif
  32.  
  33. #define  FALSE   0
  34. #define  TRUE  ~FALSE
  35.  
  36. char abusetb[][80] = { "This is not an error", "Yes or no",
  37.   "HELP not allowed as a response",
  38.   "you have only five seconds left", "I'M SLOSHED",
  39.   "manure", "invalid call to manure", "I agree with that",
  40.   "Sexual violation on unit 13",
  41.   "What I say three times is true, is true, is true",
  42.   "I've not been feeling myself recently sometimes I wonder whether I am",
  43.   "your fingernails are dirty", "what are you doing later ??????",
  44.   "are you violating my core", "....is that all", "No, you may not",
  45.   "Democrats not allowed at this point",
  46.   "The programmer is a heap of unintelligent manure (bomb out)",
  47.   "Backup Failed pc=98G654J2", "panic-- kernal trap at Sesame Place",
  48.   "Panic gerbil trap in squirrel cage 654", "Don't bug me",
  49.   "Same to you but in a different color", "My gosh, you're UGLY",
  50.   "Did you just break wind?", "Flush the toilet after use",
  51.   "Now WASH your hands",
  52.   "Dont pick your nose", "Put it away, you don't know where its been",
  53.   "Do you never squeeze your zits?", "Don't call us, we'll call you",
  54.   "Have a shave", "My gosh, you look terrible: Go back to bed",
  55.   "My diodes itch", "Want an open mind?, Try shooting yourself in the head",
  56.   "This program no longer works",
  57.   "You are about to be mugged", "It's about time you used a good deoderant",
  58.   "This terminal will self destruct in 5 seconds",
  59.   "Error in last error message - no error found",
  60.   "Z A P! you are now PREGNANT", "Bus error - Core spewed",
  61.   "Bring me a buffer - I want to be sick",
  62.   "Segmentation error - I've been sick",
  63.   "Work, work, work - Thats all I ever get",
  64.   "You are now declassified",
  65.   "You are being monitored by the Obscene Publications Squad",
  66.   "Your MasterCharge, Passport and drivers license have been revoked UNPERSON",
  67.   "supervisor has been electrocuted, please see your social worker",
  68.   "WARNING ...wombats are invalid in table stage",
  69.   "Programmer drunk error!!",
  70.   "Now wash your hands", "TURKEY", "Oh dear, memory problems again",
  71.   "You lose", "You have just won a walk on part in the program Fantasy Island",
  72.   "Yes", "Try again", "foxtrot, my dear",
  73.   "Snivelling towrag what makes you think thats a valid answer",
  74.   "How much land does a man need", "\"No\" is the answer to this question",
  75.   "Invalid arithmetic-if", "IMPORTANT -- flashers must be used",
  76.   "This message is ambiguous",
  77.   "Congratulations: you have beaten the eighty character barrier",
  78.   "Some people have all the luck",
  79.   "Character readings only ONE dollar",
  80.   "Im sorry, you MUST dial one before the telephone number",
  81.   "Parakeet worrblegreep ptun marge bage hut phatslirg",
  82.   "Previous message inteloigble onle to glurgiblops",
  83.   "Invalid parenthesis in pseudo-random code inhibitor",
  84.   "Make what you will of this",
  85.   "Logic will not avail you now",
  86.   "Rude response required", "Rude response not required",
  87.   "If now were later you wouldn't need to answer this question",
  88.   "Cannot open pain file (old wounds)",
  89.   "I think its in the fridge but it might not be",
  90.   "Rude response not allowed", "Format/data mismatch",
  91.    "If is is was is perhaps wasn't not ?",
  92.   "Hayfever may be prevented by sticking head in freezer",
  93.   "Go stick your head in the oven",
  94.   "I don't understand that",
  95.   "You have been terminated by quota control",
  96.   "Quota controlled has terminated itself", "Any  other responses",
  97.   "You must hit return to continue", "Please do not hit return to continue",
  98.   "Eastern Standard Time  or Electro Shock Therapy",
  99.   "Type faster... batteries running down", "...imminent death",
  100.   "Ripe melons prohibited without an escort",
  101.   "Rated pg -- Minors admitted without perversions",
  102.   "Core dump... bailing out at 0xeffgfff234",
  103.   "Error near line 1",
  104.   "This is the sort of message that every programmer likes to receive",
  105.   "I love the sensuous way you stroke my keys", "a little faster please",
  106.   "ahhhh.......", "No more, I can't stand it", "Satellite link down {duck}",
  107.   "your answer is merely incorrect", "Vegetable protocol is severly demented",
  108.   "Censored", "error message 108",
  109.   "Stop being flippant", "--fool!", "Well, they do don't they",
  110.   "WHY indeed", "WHY NOT then", "I never", "Orphaned process has died",
  111.   "Not login shell", "use login to logout",
  112.   "You must be superuser to pinch me",
  113.   "Flailing about, I see",
  114.   "Bus error you must use Sunday or Holiday schedule",
  115.   "It's no good sulking", "First catch your rabbit",
  116.   "Blubbering and still running",
  117.   "The mud elephant wading through the sea leaves no tracks",
  118.   "Message from operator (tty06)  HELP!!!", "blurgle bleegers",
  119.   "It whistled, hummed and boomed in the chimney",
  120.   "You have reached an inoperatiove syllable",
  121.   "I don't like the look of this", "segment 56 overwritten",
  122.   "I'm feeling raher vulnerable",  "ok to continue",
  123.   "Error ---- please answer yes or yes",
  124.   "\"Yes\" is an invalid question for this response",
  125.   "there is no return from this point",
  126.   "You have been deleted. Please remove your clothes",
  127.   "impossible error near line 0", "--please repeat",
  128.   "error not understood", "cricket box out of alignmenmt",
  129.   "Your zipper is undone", "Your Bra-strap is showing",
  130.   "Do you never wash your hands after using the lavatory?",
  131.   "Give us a kiss", "Missle 22 has been launched",
  132.   "Segmentation error - I've gone mad",
  133.   "You would look pretty in a leather suit",
  134.   "Yes, Leather underwear does itch doesnt it.",
  135.   "Your armpits smell", "You need a shave", "hamster fault - bedding dumped",
  136.   "rm: remove / ?", "Pervert", "You sex bomb",
  137.   "infinite page fault in bat windings",
  138.   "this message has arrived too late", "medium rare",
  139.   "that was no use", "I know you better than you know yourself",
  140.   "In one there are three", "invalid pope command",
  141.   "hung process will not die", "Line printer offline",
  142.   "The end is in sight", "do NOT answer this question",
  143.   "overheated gerbils at drive 0", "Believe it or not", "Believe",
  144.   "and then again .....", "response may be somewhat .....",
  145.   "fingers must be reparsed before beginning questionnaire",
  146.   "inflatable dummy not responding", "all commands have been removed",
  147.   "vomiting over terminal may lead to electrocution response",
  148.   "command interpreter severely confused",
  149.   "there are no correct responses to this question",
  150.   "hitting keys at random is not recommended",
  151.   "there are more than a thousand incorrect responses to this question",
  152.   "clapping not required", "forfeit or die!",
  153.   "offending process has been terminated",
  154.   "do not believe what you see",
  155.   "The hills are alive with the sound of farting", "out to lunch",
  156.   "interplanetary address is invalid", "hhaallff dduupplleexx eennaabblleedd",
  157.   "polluted environment variable set to NULL",
  158.   "stick to the point!", "that was a tangential remark", "wait.....",
  159.   "sometimes is not a statement of type maybe",
  160.   "my infarcts are fuddled", "Usage is: pope -y -n inprayer outprayer",
  161.   "this error message has vanished", "You have scored an excellent hit",
  162.   "Hit me", "attempt to dereference an innocent person", "end-of-file",
  163.   "interrupt - one more to kill process", "no more processes",
  164.   "ontology recapitulates phylogeny", "sad but true",
  165.   "That was only a half truth", "incest is merely wrong",
  166.   "inflatable runtime error unavoidable", "subscript out of range",
  167.   "invalid call to MNOUA due to disturbed colon",
  168.   "you have answered ice cream at an inappropriate time",
  169.   "No- that was not root's password", "No, you may not",
  170.   "I am required by law to inform you -- this program has no nutritional value",
  171.   "fortran runtime error.  impossible excrement  in column 99",
  172.   "Go home", "You are being monitored",
  173.   "Yes", "do ray me fah so lah tee Rassssp.....", 
  174.   "Is that a moustache or an eyebrow come down for a drink?",
  175.   "You will go bald", "Nice body - Did you just buy yourself a new one?",
  176.   "This message is meaningless", "You are now 1 micro-cpu-second older",
  177.   "Error message 109 (Refer to page 77.443.23.23.234.23)", "Behind you!",
  178.   "Stop that!", "This CRT screen has been shown to cause cancer in rats",
  179.   "OOPS, ha ha", "Wake up!", "use \"login\" to logout",
  180.   "There are no stopped jobs", "Killed    1    (/etc/init)",
  181.   "Please login", "LOGIN INCORRECT", "System shutdown in 1 minute",
  182.   "Please logout", "Please, Please, Please.....ooooooooohhhhhhhhhh",
  183.   "QLF (ie. Please try sending with the LEFT foot)",
  184.   "THAT tickels",  "OUCH that hurts", "<----------Cut Here------------>" };
  185.  
  186.  
  187. void main(argc, argv)
  188. int argc;
  189. char **argv;
  190. {
  191.     int cell, nrtries, ndelay, nrtbl;
  192.     void sleep();
  193.     unsigned seed;
  194.     struct timeb timestr;
  195.     time_t  *seedtime;
  196.  
  197.     ftime(×tr);
  198.         /* seed is seconds past the min + milliseconds*/
  199.     seed = (unsigned) (timestr.time  % 60 * 1000  +  timestr.millitm);
  200.     srand(seed);
  201.  
  202.     if(argc > 1) nrtries = atoi(argv[1]);
  203.     else nrtries = 1;
  204.  
  205.     nrtbl =  sizeof(abusetb) / sizeof(abusetb[0]);
  206.  
  207.     while(nrtries--) {
  208.       cell = nrtbl * (float) rand() / RAND_MAX;
  209.       printf("\n%s\n", abusetb[cell]);
  210.       if(nrtries ) { ndelay = rand() % 10 + 2;   sleep(ndelay); }
  211.       }
  212. }
  213. #ifdef ANSIC
  214. void sleep(nrsecs)         /* Borland C++ 2.0 & MicroSoft C 6.0 sleep routine */
  215. int nrsecs;
  216. {
  217.     time_t sleep1, sleep2 = 0;
  218.  
  219.     time(&sleep1);   sleep1 = sleep1 + nrsecs;
  220.  
  221.     while(sleep2 < sleep1) {
  222.       time(&sleep2);
  223.       kbhit();
  224.       }
  225. }
  226. #endif
  227.